package my.mall.db.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;

/**
 * <p>
 * 资源表
 * </p>
 *
 * @author fengbo
 * @since 2024-04-22
 */
@TableName("mall_resource")
class Resource {

    @TableId(value = "id", type = IdType.AUTO)
    var id: Long? = null

    /**
     * 资源
     */
    var resourceKey: String? = null

    /**
     * 资源描述
     */
    var resourceLabel: String? = null

    /**
     * 资源类型：1-一级菜单(目录)；2-二级菜单；3-操作; 4-数据查看
     */
    var resourceType: Byte? = null

    /**
     * 父菜单id
     */
    var parentId: Long? = null

    /**
     * 删除标记，0-未删除；1-删除
     */
    var deletedFlag: Byte? = null

    companion object {

        const val ID : String = "id"


        const val RESOURCE_KEY : String = "resource_key"


        const val RESOURCE_LABEL : String = "resource_label"


        const val RESOURCE_TYPE : String = "resource_type"


        const val PARENT_ID : String = "parent_id"


        const val DELETED_FLAG : String = "deleted_flag"

    }

    override fun toString(): String {
        return "Resource{" +
        "id=" + id +
        ", resourceKey=" + resourceKey +
        ", resourceLabel=" + resourceLabel +
        ", resourceType=" + resourceType +
        ", parentId=" + parentId +
        ", deletedFlag=" + deletedFlag +
        "}"
    }
}
